﻿using System;
using System.Runtime.InteropServices;
using DWORD = System.UInt32;
using WORD = System.UInt16;
using SCORE = System.Int64;
using SCOREEX = System.Double;

public class CHAT_MSG_CODE
{
    public const int CHAT_MSG_OK = 0; //消息成功
    public const int CHAT_MSG_ERR = 1; //消息失败

    //用户状态
    public const int FRIEND_US_OFFLINE = 0; //下线状态
    public const int FRIEND_US_ONLINE = 1; //在线状态

    //登录命令= 
    public const int MDM_GC_LOGON = 1; //登录信息

    public const int SUB_GC_PC_LOGON_USERID = 100; //pc登录
    public const int SUB_GC_MB_LOGON_USERID = 101; //手机登录

    //登录结果=
    public const int SUB_GC_LOGON_SUCCESS = 200; //登录成功
    public const int SUB_GC_LOGON_FAILURE = 210; //登录失败

    //用户信息=
    public const int SUB_S_USER_GROUP = 302; //用户分组
    public const int SUB_S_USER_FRIEND = 303; //用户好友
    public const int SUB_S_USER_REMARKS = 304; //用户备注	
    public const int SUB_S_USER_SINDIVIDUAL = 305; //简易资料			
    public const int SUB_S_LOGON_AFRESH = 306; //用户重入
    public const int SUB_S_LOGON_FINISH = 307; //登录完成


    //-
    //用户命令
    //-
    public const int MDM_GC_USER = 3; //用户信息

    public const int SUB_GC_USER_STATUS_NOTIFY = 1; //用户状态(上下线)
    public const int SUB_GC_GAME_STATUS_NOTIFY = 2; //游戏动态()
    public const int SUB_GC_GAME_SCORE_NOTIFY = 3; //分数变化通知

    public const int SUB_GC_USER_CHAT = 100; //用户聊天	
    public const int SUB_GC_APPLYFOR_FRIEND = 101; //申请好友
    public const int SUB_GC_RESPOND_FRIEND = 102; //好友回应
    public const int SUB_GC_SEARCH_USER = 103; //查找用户
    public const int SUB_GC_INVITE_GAME = 104; //邀请游戏
    public const int SUB_GC_TRUMPET = 105; //用户喇叭
    public const int SUB_GC_DELETE_FRIEND = 106; //删除好友
    public const int SUB_GC_UPDATE_COORDINATE = 109; //更新坐标
    public const int SUB_GC_GET_NEARUSER = 110; //附近的人
    public const int SUB_GC_QUERY_NEARUSER = 111; //查询附近
    public const int SUB_GC_USER_SHARE = 112; //分享消息
    public const int SUB_GC_INVITE_PERSONAL = 113; //私人房邀请

    public const int SUB_GC_USER_CHAT_NOTIFY = 200; //聊天通知
    public const int SUB_GC_APPLYFOR_NOTIFY = 201; //申请通知
    public const int SUB_GC_RESPOND_NOTIFY = 202; //回应通知
    public const int SUB_GC_SEARCH_USER_RESULT = 203; //查找结果
    public const int SUB_GC_INVITE_GAME_NOTIFY = 204; //邀请通知
    public const int SUB_GC_TRUMPET_NOTIFY = 205; //喇叭通知
    public const int SUB_GC_DELETE_FRIEND_NOTIFY = 206; //删除通知
    public const int SUB_GC_UPDATE_COORDINATE_NOTIFY = 209; //更新坐标
    public const int SUB_GC_GET_NEARUSER_RESULT = 210; //附近结果
    public const int SUB_GC_QUERY_NEARUSER_RESULT = 211; //查询结果
    public const int SUB_GC_USER_SHARE_NOTIFY = 212; //分享通知
    public const int SUB_GC_INVITE_PERSONAL_NOTIFY = 213; //私人房邀请通知

    public const int SUB_GC_USER_SCORE_CHANGE = 217; //用户分数  用户的金币
    public const int SUB_GC_WHEEL_NOTIFY = 218; //转盘通知

    public const int SUB_GC_USER_CHAT_ECHO = 300; //聊天反馈
    public const int SUB_GC_APPLYFOR_FRIEND_ECHO = 301; //申请反馈
    public const int SUB_GC_RESPOND_FRIEND_ECHO = 302; //回应反馈
    public const int SUB_GC_SEARCH_USER_ECHO = 303; //查找反馈
    public const int SUB_GC_INVITE_GAME_ECHO = 304; //邀请反馈
    public const int SUB_GC_TRUMPET_ECHO = 305; //喇叭反馈
    public const int SUB_GC_UPDATE_COORDINATE_ECHO = 309; //更新坐标反馈
    public const int SUB_GC_GET_NEARUSER_ECHO = 310; //附近反馈
    public const int SUB_GC_QUERY_NEARUSER_ECHO = 311; //查询反馈
    public const int SUB_GC_USER_SHARE_ECHO = 312; //分享反馈
    public const int SUB_GC_INVITE_PERSONAL_ECHO = 313; //私人房邀请反馈

    public const int SUB_GC_SYSTEM_MESSAGE = 401; //系统消息
    public const int SUB_GC_NOTICE_ALL = 402; //全服通知
    public const int SUB_GC_LOBBY_MESSAGE = 403; //大厅消息

    public const int SUB_GC_OPERATE_SUCCESS = 800; //操作成功
    public const int SUB_GP_OPERATE_FAILURE = 801; //操作失败

    public const int MDM_CS_PERSONAL = 5; //用户信息
    public const int CMD_CS_C_GET_GOLD_LIST = 1; //获取金币约战房间列表
    public const int CMD_CS_C_GET_GOLD_LIST_RESLUT = 2; //获取金币约战房间列表结果
    public const int CMD_CS_C_GET_GOLD_LIST_RESLUT_END = 3; //获取金币约战房间列表结果结束
    public const int CMD_CS_C_UPDATE_TABLE_INFO = 4; //更新金币约战房间
    public const int CMD_CS_C_INSERT_TABLE_INFO = 5; //插入金币约战房间

//@region 邮件组件之协议命令//-
    public const int SUB_GC_MAIL_LOAD_MESSAGE = 10; //加载邮件 向服务器请求邮件列表
    public const int SUB_GC_MAIL_UPDATE_STATUS = 11; //更新邮件 向服务器更新单个邮件状态
    public const int SUB_GC_MAIL_RESULT_MESSAGE = 214; //查询邮件结果 服务器返回的邮件列表
    public const int SUB_GC_MAIL_RESULT_STATUS = 215; //邮件状态更新结果 服务器返回的单个邮件更新状态结果
    public const int SUB_GC_MAIL_NEW_MESSAGE = 216; //推送新邮件 服务器主动推送提示有新邮件
//@endregion 邮件组件之协议命令//-

//@region 恭喜获得之协议命令//-
    //SUB_GC_USER_SCORE_CHANGE      =217;

    //-
    //用户比赛命令
    //-
    public const int MDM_GC_MATCH = 4; //用户比赛
}


[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagClientFriendInfo
{
    //用户属性
    public DWORD dwUserID; //用户ID
    public DWORD dwGameID; //游戏id

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szNickName; //用户昵称

    public DWORD wFaceID; //头像 I D
    public DWORD dwCustomID; //头像 I D
    public byte cbGender; //性别
    public WORD cbMemberOrder; //会员等级
    public WORD wGrowLevel; //用户等级

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_UNDER_WRITE)]
    public string szSign; //个性签名

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_COMPELLATION)]
    public string szCompellation; //真实姓名

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PHONE_MODE)]
    public string szPhoneMode; //手机型号

    public byte cbGroupID; //组别标识

    //在线信息
    public byte cbMainStatus; //用户状态
    public byte cbGameStatus; //游戏状态
    public WORD wKindID; //游戏标识
    public WORD wServerID; //房间标识
    public WORD wTableID; //桌子标识
    public WORD wChairID; //椅子位置

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_SERVER)]
    public string szServerName; //房间名字
}

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagNearUserInfo
{
    //用户属性
    public DWORD dwUserID; //用户ID
    public DWORD dwGameID; //游戏id

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szNickName; //用户昵称

    public DWORD wFaceID; //头像 I D
    public DWORD wCustomID; //头像 I D
    public byte cbGender; //性别	
    public WORD cbMemberOrder; //会员等级

    public WORD wGrowLevel;

    //用户等级
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_UNDER_WRITE)]
    public string szSign; //个性签名

    // 经度纬度
    public double dLongitude; // 坐标经度
    public double dLatitude; // 坐标纬度

    public DWORD dwDistance;

    // 目标距离
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PLACE_NAME)]
    public string szPlaceName; //地名                         // 目标距离

    //用户地址
    public DWORD dwClientAddr;
}

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserFriendInfo
{
    public WORD wFriendCount; //好友数目

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
    public tagClientFriendInfo[] FriendInfo; //好友信息
};

//用户上线/离线
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserOnlineStatusNotify
{
    public DWORD dwUserID; //用户id
    public byte cbMainStatus; //用户状态
};

//游戏状态
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserGameStatusNotify
{
    public DWORD dwUserID; //用户id
    public byte cbGameStatus; //游戏状态
    public WORD wKindID; //游戏标识
    public WORD wServerID; //房间标识
    public WORD wTableID; //桌子标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_SERVER)]
    public string szServerName; //房间名字
};

//用户聊天
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserChat
{
    public DWORD dwSenderID; //用户标识
    public DWORD dwTargetUserID; //目标用户
    public DWORD dwFontColor; //字体颜色
    public byte cbFontSize; //字体大小
    public byte cbFontAttri; //字体属性

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_FONT_NAME)]
    public string szFontName; //字体名称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szMessageContent; //消息内容	
}

///申请好友
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_ApplyForNotify
{
    public DWORD dwRequestID; //用户标识
    public byte cbGroupID; //组别标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szNickName; //用户昵称 
};

//回应好友
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_RespondFriend
{
    public DWORD dwUserID; //用户标识
    public DWORD dwRequestID; //用户标识
    public byte cbRequestGroupID; //组别标识
    public byte cbGroupID; //组别标识
    public bool bAccepted; //是否接受
};

//回应通知
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_RespondNotify
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szNotifyContent; //提示内容
};

//查找好友
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_SearchByGameID
{
    public DWORD dwSearchByGameID; //用户标识
}

//查找结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_SearchByGameIDResult
{
    public byte cbUserCount;
    public tagClientFriendInfo FriendInfo;
}

//邀请游戏
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InviteGame
{
    public DWORD dwUserID; //邀请用户
    public DWORD dwInvitedUserID; //被邀用户
    public WORD wKindID; //游戏标识
    public WORD wServerID; //房间标识
    public WORD wTableID;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szInviteMsg; //邀请信息
}

// //邀请反馈
// [Serializable]
// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
// public struct CMD_GC_InviteGameEcho
// {
//     public Int64 lErrorCode; // 错误代码
//     public tagPromptString szDescribeString; // 描述信息
// };

//邀请通知
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InviteGameNotify
{
    public DWORD dwSenderID; //邀请用户
    public WORD wKindID; //游戏标识
    public WORD wServerID; //房间标识
    public WORD wTableID; //桌子标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szInviteMsg; //邀请信息
}

//私人房邀请游戏
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InvitePersonalGame
{
    public DWORD dwUserID; //邀请用户
    public DWORD dwInvitedUserID; //被邀用户
    public WORD wKindID; //游戏标识
    public DWORD dwServerNumber; //房间号码
    public WORD wTableID; //桌子标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szInviteMsg; //邀请信息
};

// 邀请反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InvitePersonalGameEcho
{
    public int lErrorCode; //错误代码
    public tagPromptString_C szDescribeString; //描述信息
}

//邀请通知
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InvitePersonalGameNotify
{
    public DWORD dwSenderID; //dwInviteUserID					--邀请用户
    public WORD wKindID; //游戏标识
    public DWORD dwServerNumber; //房间号码
    public WORD wTableID; //桌子标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szInviteMsg; //邀请信息
};

//用户喇叭(发包结构)
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Trumpet_C
{
    public WORD wPropertyID; //道具索引
    public DWORD dwSenderID; //用户标识
    public DWORD dwFontColor; //字体颜色

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //用户昵称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szMessageContent; //消息内容
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
//用户喇叭(回包结构)
public struct CMD_GC_Trumpet_S
{
    public WORD wPropertyID; //道具索引
    public DWORD dwSenderID; //用户标识
    public DWORD dwFontColor; //字体颜色

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //用户昵称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szMessageContent; //消息内容
};

//系统消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_S_SystemMessage
{
    public byte cbLanguage;
    public WORD wType; //消息类型
    public WORD wLength; //消息长度

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
    public string szMessageContent; //消息内容
};

// 喇叭通知/喇叭反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_TrumpetEcho
{
    public int lErrorCode; //错误代码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szDescribeString; //描述消息
};

//删除好友
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_DeleteFriend
{
    public DWORD dwUserID; //用户标识(自己)
    public DWORD dwFriendUserID; //用户标识(好友)
    public byte cbGroupID; //组别标识
}

//删除反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_DeleteFriendEcho
{
    public int lErrorCode; //错误代码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szDescribeString; //描述消息
};

//删除结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_DeleteFriendNotify
{
    public DWORD dwFriendUserID; //用户标识
};

// 更新坐标
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Update_Coordinate
{
    public DWORD dwUserID; //用户标识
    public double dLongitude; //坐标经度
    public double dLatitude; //坐标纬度

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)]
    public string szPlaceName;
};

//坐标通知
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Update_CoordinateNotify
{
    public double dLongitude; //坐标经度
    public double dLatitude; //坐标纬度
    public DWORD dwClientAddr; //用户地址
};

// 获取附近
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Get_Nearuser
{
    public DWORD dwUserID; //用户标识
    public double dLongitude; //坐标经度
    public double dLatitude; //坐标纬度
};

// 附近反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Get_NearuserEcho
{
    public int lErrorCode; //错误代码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szDescribeString; //描述消息
};

//附近结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Get_NearuserResult
{
    public byte cbUserCount; //用户数目
    // public tagNearUserInfo NearUserInfo; //附近信息
};

// 查询附近
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Query_Nearuser
{
    public DWORD dwUserID; //用户标识
    public DWORD dwNearuserUserID; //附近用户
};

// 分享消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserShare
{
    public DWORD dwUserID; // 用户标识
    public DWORD dwSharedUserID; // 被分享用户

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szShareImageAddr; // 图片地址

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szMessageContent; // 消息内容
};

// 分享反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_InviteGameEcho
{
    public int lErrorCode; // 错误代码
    public tagPromptString_C szDescribeString; // 描述信息
};

//分享通知
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserShareNotify
{
    public DWORD dwSenderID; //dwShareUserID//用户标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szShareImageAddr; // 图片地址

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szMessageContent; // 消息内容
};

//操作失败
//
// [Serializable]
// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
// public struct CMD_GC_OperateFailure
// {
// 	public int lErrorCode; //错误代码
// 	public int lResultCode; //操作代码
//
// 	[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
// 	public string szDescribeString; //错误信息
// };

/// <summary>
/// 操作成功
/// </summary>
// [Serializable]
// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
// public struct CMD_GC_OperateSuccess
// {
//     public int lResultCode; //操作代码
//
//     [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
//     public String szDescribeString; //错误信息
// }
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_SC_C_PersonalGoldRoomListResult
{
    public DWORD dwServerID; //房间I D
    public DWORD dwKindID; //房间类型
    public DWORD dwTableID; //桌子I D
    public DWORD dwUserID; //桌主I D
    public double lCellScore; //房间底分
    public DWORD dwPersonalRoomID; //约战房间ID
    public WORD wJoinGamePeopleCount; //参与游戏的人数
    public DWORD dwRoomTax; //单独一个私人房间的税率，千分比
    public byte cbPlayMode; //0 积分模式	1 金币模式

    public double lEnterScoreLimit; //进入房间上限
    public double lLeaveScoreLimit; //离开房间下线

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = Protocal.RULE_LEN)]
    public byte cbGameRule; //游戏规则 弟 0 位标识 是否设置规则 0 代表设置 1 代表未设置

    public bool bGameStart; //游戏是否开始

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //桌主姓名

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.PERSONAL_ROOM_CHAIR)]
    public DWORD[] dwJoinUserID; //约战房间内的玩家

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.PERSONAL_ROOM_CHAIR)]
    public DWORD[] dwFaceID; //玩家头像

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.PERSONAL_ROOM_CHAIR)]
    public DWORD[] dwCustomID; //玩家自定义头像

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = Protocal.PERSONAL_ROOM_CHAIR, ArraySubType = UnmanagedType.Struct)]
    public szJoinUserNickName[] szJoinUserNickNames; //玩家昵称
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct szJoinUserNickName
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    private string name;
}

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_SC_C_PersonalGoldRoomUpdate
{
    public byte cbStatus; //0 坐下， 1 离开， 2 删除房间 3 创建房间爱你
    public bool bGameStart; //游戏是否开始
    public DWORD dwServerID; //房间I D
    public DWORD dwKindID; //房间类型
    public DWORD dwTableID; //桌子I D
    public DWORD dwUserID; //玩家I D
    public DWORD wChairID; //座位I D

    public DWORD dwPersonalRoomID; //约战房间ID
    public DWORD dwFaceID; //玩家头像
    public DWORD dwCustomID; //玩家自定义头像

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //玩家昵称
};

//@region 邮件组件之协议结构--------------------------
//更新邮件状态
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UpdateMailStatus
{
    public DWORD dwMailID; //邮件 I D
    public byte cbMailStatus; //邮件状态  1 已读取or领取 2已读未领取 4删除
};

//查询邮件结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct DBO_MailMessageResult
{
    public WORD wMailCount; //邮件数量 结构体个数
    public bool bRecordEnd; //记录结束
};

//邮件正文
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagMailInfo
{
    public byte cbLanguage; //语言
    public WORD dwMailID; //邮件 I D
    public byte cbMailStatus; //邮件状态

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szSendNames; //发件人

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 30)]
    public string szMailTitles; //邮件标题

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 30)]
    public string szMailTimes; //邮件时间

    public WORD wContentLength; //正文长度 中文字符

    public bool bHavePackage; //包含礼包
    // public string    szMailContents=512};// 长度可变，单独读取					--邮件正文
};

//邮件正文附加的礼包信息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagMailPackageInfo
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 30)]
    public string szPackageNames; //礼包名称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
    public string szPackageInfos; //礼包详情

    public WORD wListLength; //礼包长度
    // public string    szGoodsLists=128};	-- 长度可变，单独读取				--礼包物品
};


[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_MailStatusResult
{
    public DWORD dwMailID; //邮件标志
    public byte cbMailStatus; //邮件状态
    public double lUserScore; //用户金币
    public double lUserInsure; //用户银行
    public SCORE lUserDiamond; //用户钻石
    public int nUserTicket; //用户奖券
    public int lStrID; //描述ID

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szNotifyContents; //描述消息
};

//系统消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GR_SendMessage
{
    public byte cbLanguage;
    public byte cbGame;
    public byte cbRoom;
    public byte cbAllRoom;
    public byte cbLoop; // 循环标志
    public DWORD dwTimeRate; ////循环间隔
    public SCORE tConcludeTime; //消息长度
    public WORD wChatLength; //消息长度

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szTitle; //消息长度

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szMessageContent; //消息内容
};


//系统消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_CS_C_UpdateUserScore
{
    public int nRequestID; // 请求id
    public DWORD dwUserID; // 用户ID
    public byte cbUpdateType; // 更新方式(0增量 1修改)
    public double lUpdateScore; // 更新分数 金币
    public double lUpdateSilver; // 更新银币
    public byte cbEventID; // 事件id(0充值 1.提现 2后台修改)
    public double lEventData; // 事件数据(充值额度 or 提现额度)

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szOrderIDs; // 订单ID
};

//@endregion 邮件组件之协议结构--------------------------

//查询结果(请勿移动位置，易引发严重后果)
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Query_NearuserResult
{
    public byte cbUserCount; //用户数目
    public tagNearUserInfo NearUserInfo; //用户信息
};

//坐标反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Update_CoordinateEcho
{
    public int lErrorCode; //错误代码
    public tagPromptString_C PromptString; //提示语
};

//查询反馈
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_Query_NearuserEcho
{
    public int lErrorCode; //错误代码
    public tagPromptString_C PromptString; //提示语
};

//通用反馈消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_ECHO
{
    public int lErrorCode; //错误代码
    public tagPromptString_C PromptString; //提示语
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_UserLogonAfresh
{
    public tagPromptString_C PromptString; //提示语
};

//登录失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_LogonEcho
{
    public int lErrorCode; //错误代码
    public tagPromptString_C PromptString; //提示语
};

//大厅消息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_CM_LobbyMessage
{
    public WORD wType; //消息类型(跑马灯使用SMT_CARD)
    public tagPromptStringEx_C PromptString; //消息内容
};